package com.common.retrofit.methods;

import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.entity.bean.UserBean;
import com.common.retrofit.service.HaiNingService;

import java.util.List;

import rx.Observable;
import rx.Subscriber;

public class RegisterSetPswMethods extends BaseMethods {

    private static RegisterSetPswMethods m_ins = null;

    public static RegisterSetPswMethods getInstance() {
        if (m_ins == null) {
            synchronized (RegisterSetPswMethods.class) {
                if (m_ins == null) {
                    m_ins = new RegisterSetPswMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "User/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }


    public void uRegister(Subscriber<UserBean> subscriber,
                      String username ,
                      String password  ,String repeatpwd   ) {
        Observable observable = initService().uRegister(System.currentTimeMillis()+"",
                "6f979fd76ce044dad0cefcfed2efff95",username,password,repeatpwd
        );
        toSubscribe(observable, subscriber);
    }
}
